<div class="alert alert-info">
{lang code='link_video_msg'}
</div>
{assign var='video_fields' value=$Upload->load_video_fields($input)}


<div class="upload_info" id="upload_form{$objId}" style="margin-top:10px; border:none">
	      
    <form name="linkUploadForm{$objId}" class="upload_form" id="linkUploadForm{$objId}" method="post" action="{link name='upload'}#currnet_{$divid}" enctype="multipart/form-data">
      
      {* Adding Remote File Form *}
      
      <h3>Remote video details</h3>
     	  <div class="form-group">
          <label for="remote_play_url">Video URL</label>
          <input type="text" name="remote_play_url" id="remote_play_url" size="15"  class="form-control" value="{"remote_play_url"|post|form_val}"/>
          <div>can be flv, mp4, m4v, ogg</div>
        </div> 
     	  <div class="form-group">
          <label>Video duration</label>
          <input type="text" name="duration" id="duration" class="form-control" value="{"duration"|post|form_val}"/>
          <div>duration format is hours:minutes:seconds</div>
        </div>
         
        <div class="form-group">
          <label for="thumb_file">Thumb file</label>
          <input name="thumb_file" type="file"  class="filefield" id="thumb_file" />
        </div>
      
      
    {foreach from=$video_fields item=field_group}
     <fieldset>
      	{* Hide fields if group is not required *}
          {if $field_group.group_id!='required_fields'} 
            <span class="remotePlayTab" 
                onclick="$('#more_fields_{$field_group.group_id}{$objId}').slideToggle()"
                    style="cursor:pointer">{$field_group.group_name}</span>
            <div id="more_fields_{$field_group.group_id}{$objId}" style="display:none">
          {else}
            <span class="form_head">{$field_group.group_name}</span>
          {/if}
    
        
           <div>
            {foreach from=$field_group.fields item=field}
            
            {if $field.name!='category[]'}
                <div class="form-group">
                <label for="{$field.id}">{$field.title}</label>
                {if $field.hint_1}<small>{$field.hint_1}</small>{/if}
                {$field.class="form-control"}
                {if $field.type == "radiobutton"}
                  {$field.label_class = "radio"}
                  {$field.notShowSeprator = "yes"}
                {/if}
                {$formObj->createField($field)}
                {if $field.hint_2}
                <div class="hint">{$field.hint_2}</div>{/if}
                </div>
            {else}
                {assign var='category_array' value=$field}
            {/if}
            
            {/foreach}
            </div>
            
            {* Loading Category in a seperate dive so they can fit properly*}
            {if $category_array}
            <div>
                <div class="field">
                <label for="{$field.id}" class="label">{$category_array.title}</label>
                {if $category_array.hint_1}<div>{$category_array.hint_1}</div>{/if}
                <div>
                    {if $category_array.type == "checkbox"}
                      {$category_array.label_class = "checkbox"}
                    {/if}
                    {$formObj->createField($category_array)}
                </div>
                {if $category_array.hint_2}
                <div>{$category_array.hint_2}</div>{/if}
                </div>
            </div>
            
            
            {assign var='category_array' value=''}
            {/if}

			{if $field_group.group_id=='required_fields'}<div class="clearfix"></div>{/if}
         
        {* Closing Div for hidden fields *}   
        {if $field_group.group_id!='required_fields'} 
        </div>
        {/if}
      </fieldset>
    {/foreach}	

	   <input name="submit_upload" type="hidden" value="just_do_it">
     <input id="embed_upload_id" name="submit_upload" type="hidden" value="{$objId}">
    <input type="button" name="embed_upload" id="embed_video" onClick="check_file_url('{$objId}'); return false;" value="Upload" class="btn btn-primary"/>
    </form>
    
</div>

{literal}
<style>
  .remotePlayTab{
    background-color: #47B4D8;
    margin: 5px 0;
    padding: 5px;
    display: block;
    color: #fff;
    font-weight: bold;
  }
</style>
{/literal}